#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n, m; cin >> n >> m;
    vector<int> arr(n + 1), diff(n + 1);
    for(int i = 1; i <= n; ++i) cin >> arr[i];
    for(int i = 1; i <= n; ++i) diff[i] = arr[i] - arr[i - 1];
    while(m--)
    {
        int l, r, c; cin >> l >> r >> c;
        diff[l] += c;
        diff[r + 1] -= c;
    }
    int cur = 0;
    for(int i = 1; i <= n; ++i)
    {
        cur += diff[i];
        cout << cur << ' ';
    }
    return 0;
}